package com.elh.jvm.classpath;


/**
 * @author liulei
 **/
public class ClassPath {

    /**
     * jre/lib/*
     */
    private Entry bootClasspath;

    /**
     * jre/lib/ext/*
     */
    private Entry extClasspath;

    /**
     * 用户自定义路径
     *
     */
    private Entry userClasspath;

    public ClassPath(String userClasspath) {
        parseBootAndExtClasspath();
        parseUserPath(userClasspath);
    }

    private void parseUserPath(String userClasspath) {
        this.userClasspath = new DictEntry(userClasspath);
    }

    private void parseBootAndExtClasspath() {
        String javaHome = System.getenv("JAVA_HOME");
        this.bootClasspath = new WildcardEntry(javaHome + "/jre/lib/*");
        this.extClasspath =  new WildcardEntry(javaHome + "/jre/lib/ext/*");
    }


}
